import request from '@/utils/request.js'
const PATH = '/admin/courseBook'

// 分页查询课程书籍
export const getCourseBookList = ({ page, pageSize, bookName, categoryId }) => {
  return request.get(PATH + '/page', {
    params: {
      page,
      pageSize,
      bookName,
      categoryId
    }
  })
}

// 新增课程书籍
export const insertCourseBook = (data) => {
  return request.post(PATH + '/insert', data)
}

// 批量删除课程书籍
export const batchDeleteCourseBook = (ids) => {
  return request.delete(PATH + '/batchDelete', {
    params: {
      ids: ids.join(',')
    }
  })
}

// 根据id查询课程书籍
export const getCourseBookById = (id) => {
  return request.get(PATH + '/getCourseBookById', {
    params: {
      id
    }
  })
}

// 修改课程书籍信息
export const updateCourseBook = (data) => {
  return request.put(PATH + '/update', data)
}
